///import js-src/lib/
///import js-src/com/
qui(function (require, exports, module) {
    live2VOD.Config = $.extend({}, Ancestor.Config, {

        TABLE_COLMODEL_CONFIG: {
            channelname: {
                name: "channelname",
                index: 'channelname',
                title: false,
                width: 80,
                sortable: false,
                align: "center"
            },
            channelalias: {
                name: "channelalias",
                index: 'channelalias',
                title: false,
                width: 140,
                sortable: false,
                align: "center"
            },
            channeltype: {
                name: "channeltype",
                index: 'channeltype',
                title: false,
                width: 140,
                sortable: false,
                align: "center",
                hidden: true
            },
            channeltypeShow: {
                name: "channeltypeShow",
                index: 'channeltypeShow',
                title: false,
                width: 140,
                sortable: false,
                align: "center"
            },

            ugcid: {
                name: "ugcid",
                index: 'ugcid',
                title: false,
                width: 110,
                sortable: false,
                align: "center"
            },
            ugcname: {
                name: "ugcname",
                index: 'ugcname',
                title: false,
                width: 110,
                sortable: false,
                align: "center"
            },
            qipuid: {
                name: "qipuid",
                index: 'qipuid',
                title: false,
                width: 135,
                sortable: false,
                align: "center"
            },
            ugcmsg: {
                name: "ugcmsg",
                index: 'ugcmsg',
                title: false,
                width: 135,
                sortable: false,
                align: "center"
            },
            ptype: {
                name: "ptype",
                index: 'ptype',
                title: false,
                width: 110,
                sortable: false,
                align: "center",
                formatter: function (v, o, r) {
                    return live2VOD.Util.formatter.toUpperCase(v, o, r);
                }
            },
            operate: {
                title: false,
                width: 105,
                sortable: false,
                formatter: function (v, o, r) {
                    return live2VOD.Util.formatter.operate(v, o, r);
                }
            }
        },
        TABLE_LIST: {
            localReader: {
                id: "qipuid",
                root: "rows",
                page: "page",
                total: "total",
                records: "records"
            },
            multiselect: false,
            datatype: "local",
            height: 450,
            rowNum: 80,
            caption: "打点列表",
            colNames: ["电视台", "代号", "未格式化频道","频道", "关联UGC用户ID", "当前昵称", "分甘同味合作方ID", "分甘同味合作方", "节目类型", "操作" ],
            colModel: ["channelname", "channelalias", "channeltype", "channeltypeShow", "ugcid", "ugcname", "qipuid", "ugcmsg" , "ptype", "operate"],
            pager: "#pager",
            onPaging: function (pgButton) {
                var retValue = live2VOD.Util.pageBeanPageHandler("list", "pager", live2VOD.Config.PageBean, pgButton);
                if (retValue != null) {
                    $("#list")[0].addJSONData(retValue)
                }
                return "stop";
            }
        },
        PageBean: null,
        EDIT_VALIDATOR: {
            rules: {
                channelname: "required",
                channelalias:{
                    required:true,
                    selfReg:/^[A-Z0-9]+$/
                },
                ugcid: {
                    required:true,
                    digits: true
                },
                ugcname: "required",
                qipuid:  {
                    required:true,
                    digits: true
                },
                ugcmsg: "required"
            },
            messages: {
                channelname:{
                    required:"电视台不能为空"
                },
                channelalias:{
                    required:"代号不能为空"
                },
                ugcid:{
                    required:"关联UGC用户ID不能为空",
                    digits:"必须是整数"
                },
                ugcname:{
                    required:"当前昵称不能为空"
                },
                qipuid:{
                    required:"分甘同味合作方ID不能为空",
                    digits:"必须是整数"
                },
                ugcmsg:{
                    required:"分甘同味合作方不能为空"
                }
            }
        }
    })


})